package pl.edu.pw.elka.jtrzasko.proz.warcaby.actions.server;

import javax.swing.SwingUtilities;

import pl.edu.pw.elka.jtrzasko.proz.warcaby.messages.server.ServerMessage;
import pl.edu.pw.elka.jtrzasko.proz.warcaby.messages.server.ServerMessagePlayerColor;
import pl.edu.pw.elka.jtrzasko.proz.warcaby.view.ClientView;

public class ServerActionPlayerColor extends ServerAction {

	public void run(final ClientView clientView, final ServerMessage message) {
		SwingUtilities.invokeLater(new Runnable()
		{
			public void run()
			{
				clientView.setClientColor(((ServerMessagePlayerColor)message).getClientColor());
				clientView.getTextClientColor().setText(String.valueOf(((ServerMessagePlayerColor)message).getClientColor()));
				clientView.getTextClientStatus().setText("Waiting for all players");
			}
		});
	}

}
